#!/sbin/openrc-run

name=$RC_SVCNAME
daemon=/usr/bin/$name
conf=${opentracker_conf:-/etc/opentracker/$RC_SVCNAME.conf}
pidfile=/run/$RC_SVCNAME.pid

depend() {
	need net
	after firewall
}

start() {
	ebegin "Starting ${name}"
	start-stop-daemon --start --quiet \
		--make-pidfile \
		--pidfile ${pidfile} \
		--background \
		--stdout /dev/null \
		--stderr /dev/null \
		--exec ${daemon} \
		-- \
		-d /var/empty \
		-f $conf \
		-u ${opentracker_user:-opentracker} \
		${opentracker_opts}
	eend $?
}

stop() {
	ebegin "Stopping ${name}"
	start-stop-daemon --stop --quiet --pidfile ${pidfile} \
		--exec ${daemon}
	eend $?
}

